<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:51:"D:\webroot\tongji/app/home\view\fos/subscrible.html";i:1543718762;s:48:"D:\webroot\tongji/app/home\view\common/head.html";i:1539420927;s:50:"D:\webroot\tongji/app/home\view\common/footer.html";i:1542422876;}*/ ?>
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href='__HOME__/css/aui.css' rel='stylesheet' />
<style>
  .aui-bar-nav{background:white;}
  .aui-bar-nav .aui-btn .aui-iconfont{color:black;}
  body{background:#ffffff;margin-bottom:3rem;}
  .aui-bar-nav .aui-title{color:black;}
  
  .btns .aui-btn{height:2.5rem;background:white;box-shadow:0px 0px 14px #d5d5d5;border-radius:5px;}
  .aui-col-xs-3 { margin: 10px 4%;}
  .aui-btn-block{line-height:1rem;padding-top:0.3rem;}
  .btns img{height:0.8rem;display:inline}
  .pay_btns p{line-height:2rem;}
  
  .circle{height:12rem;line-height:2.5rem;text-align:center;border-radius:50%;width:12rem;margin:auto;margin-bottom:1rem;position:relative;background:linear-gradient(40deg, #2d20ff, #ff0000);}
  
  
  .cp_circle{height:12.1rem;border-radius:50%;}
  .process h1{font-size:3rem;}
  .buy_btns .aui-col-xs-5:nth-child(1) .aui-btn{background:#fd687d;padding:10px 0; height:3rem;}
  .buy_btns .aui-col-xs-5:nth-child(2) .aui-btn{background:#545dff;padding:10px 0;height:3rem;}
  .buy_btns .aui-col-xs-5{margin:10px 4%;}
  .buy_btns p{color:white;}
  .btns .aui-col-xs-4{margin:10px 0}
  p{color:black;}
  
  .inner_circle{position:absolute;
    border-radius:50%;
    width: 10.4rem;
    height: 10.4rem;
    top: 0.8rem;
    border:2px dotted;
    left: 0.8rem;
    border-color:#c5c5c5;
    z-index:2
    }
  
  .process{background:white;width:11rem;height:11rem;position:absolute;left:0.5rem;top:0.5rem;border-radius:50%;z-index:1;padding-top:1.5rem; box-sizing:border-box;}
  
  .cp_circle span{width:50px;height:10rem;position: absolute;background:white;}
  .cp_circle span:nth-child(1){transform:rotate(25deg);background:white;transform-origin:650% 66%;}
  .cp_circle span:nth-child(2){transform:rotate(36deg);background:white;transform-origin:50% 50%;}
  .cp_circle span:nth-child(3){transform:rotate(54deg);background:white;transform-origin:50% 50%;}
  .cp_circle span:nth-child(4){transform:rotate(72deg);background:white;transform-origin:50% 50%;}
  .cp_circle span:nth-child(5){transform:rotate(90deg);background:white;transform-origin:50% 53%;}
  .cp_circle span:nth-child(6){transform:rotate(92deg);background:white;transform-origin:36% 62%;;}
  .cp_circle span:nth-child(7){transform:rotate(126deg);background:white;transform-origin:56% 56%;}
  .cp_circle span:nth-child(8){transform:rotate(144deg);background:white;transform-origin:58% 61%;}
  .cp_circle span:nth-child(9){transform:rotate(162deg);background:white;transform-origin:52% 61%;}
  .cp_circle span:nth-child(10){transform: rotate(159deg);
    background: white;
    transform-origin: 20% 63%;}
  .cp_circle span:nth-child(11){transform:rotate(180deg);background:white;transform-origin: 19% 71%;width: 60px;}
  .cp_circle span:nth-child(12){transform: rotate(214deg);
    transform-origin: 36% 69%;
    background-color: white;width:60px;}
  .cp_circle span:nth-child(13){transform:rotate(232deg);background:white;transform-origin:46% 66%;}
  .cp_circle span:nth-child(14){transform:rotate(263deg);background:white;transform-origin:68% 75%;}
  .cp_circle span:nth-child(15){transform:rotate(270deg);background:white;transform-origin:0% 77%;}
  .cp_circle span:nth-child(16){transform:rotate(308deg);background:white;transform-origin:24% 95%;width:60px;}
  .cp_circle span:nth-child(17){transform:rotate(326deg);background:white;transform-origin:11% 109%;}
  .cp_circle span:nth-child(18){transform:rotate(344deg);background:white;transform-origin:4% 153%;}
  .cp_circle span:nth-child(19){transform:rotate(340deg);background:white;transform-origin:19% 84%;}
  .cp_circle span:nth-child(20){transform: rotate(360deg);
    background: white;
    width: 53px;
    margin-left: -25px;}
</style>
<title>认购FOS</title>
<body>
   <header class="aui-bar aui-bar-nav">
    <a class="aui-pull-left aui-btn aui-btn-outlined" href='javascript:history.go(-1);'>
        <span class="aui-iconfont aui-icon-left"></span>
    </a>
    <div class="aui-title">认购</div>
    <a class="aui-pull-right aui-btn aui-btn-outlined"  href='/'>
        <span class="aui-iconfont aui-icon-home"></span>
    </a>
  </header>
<div class='aui-content-padded'>
  <div class='aui-row circle'>
      <div class='inner_circle'></div>
      <div class='process'>
         <div>FOS</div>
         <h1><?php echo $amount; ?></h1>
         <p>您的帐户最多买入<?php echo $limit_amount; ?>枚</p>
      </div>
      <div class='cp_circle'>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
      </div>
  </div>
  
  <div class='aui-row btns'>
     <div class='aui-col-xs-3'>
         <div class="aui-btn aui-btn-block" style='background:#545dff;'>
             <img src='__HOME__/images/icon4.png' />
             <p style='color:white;'>FOS</p>
          </div>
     </div>
     <div class='aui-col-xs-3'>
         <div class="aui-btn aui-btn-block">
             <a href='javascript:noopen()'><p style='line-height:2rem;font-weight:bold;'>TCSN</p></a>
          </div>
     </div>
     <div class='aui-col-xs-3'>
          <div class="aui-btn aui-btn-block">
             <a href='javascript:noopen()'><img src='__HOME__/images/icon5.png' />
             <p style='font-size:0.5rem'>FOS委托交易</p></a>
          </div>
     </div>
  </div>
  
  <span id='count' style='display:none;'><?php echo intval($amount); ?></span>
  <div class='aui-row btns'>
    <div class="aui-btn aui-btn-block" style='margin:4%;width:92%'>
       <div class='aui-row'>
        <div class='aui-col-xs-3' id='reduce'>-</div>
        <div class='aui-col-xs-4'><span id='count1'>0</span>/FOS</div>
        <div class='aui-col-xs-3' id='plus'>+</div>
       </div>
    </div>
  </div>
  
  <div class='aui-row btns pay_btns'>
     <div class='aui-col-xs-3'>
         <div class="aui-btn aui-btn-block">
            <a href='javascript:noopen()'>  <p>委托1个月</p> </a>
          </div>
     </div>
     <div class='aui-col-xs-3'>
         <div class="aui-btn aui-btn-block">
             <a href='javascript:noopen()'> <p>委托3个月</p> </a>
          </div>
     </div>
     <div class='aui-col-xs-3'>
         <div class="aui-btn aui-btn-block">
            <a href='javascript:noopen()'>  <p>委托6个月</p> </a>
          </div>
     </div>
  </div>
  
  <div class='aui-row btns buy_btns'>
     <div class='aui-col-xs-5'>
         <div class="aui-btn aui-btn-block">
             <a href='/home/Mcenter/bill.html?type=fos'><img src='__HOME__/images/bill_search.png' />
             <p>订单查询</p></a>
          </div>
     </div>
     <div class='aui-col-xs-5'>
          <div class="aui-btn aui-btn-block">
             <a href='javascript:apply_buy()'><img src='__HOME__/images/icon7.png' />
                 <p>立即认购</p>
			 </a> 
          </div>
     </div>
  </div>
</div>
<input type='hidden' id='fos_count' value='0' />
<input type='hidden' id='process_count' value='<?php echo $amount; ?>' />
<script type="text/javascript" src="__HOME__/script/api.js"></script>
<script type="text/javascript" src="__HOME__/script/aui-tab.js"></script>
<script type="text/javascript" src="__HOME__/script/aui-dialog.js" ></script>
<script type="text/javascript" src="__HOME__/script/aui-toast.js" ></script>
<script type="text/javascript" src="__HOME__/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/layer/layer.js"></script>

<div id='tips' style='display:none;font-size:12px;color:gray;'>
   <pre><?php echo $buy_tips; ?></pre>
</div>

<script type="text/javascript">
    var dialog = new auiDialog({})
    var toast = new auiToast({})
	
	
	function noopen(){
	     dialog.alert({
			title:"提示",
			msg:'暂未开放',
			buttons:['确定']
		 })
	}
    
    $(function(){
        setchart();
        $("#reduce").click(function(){
            var c = parseInt($("#count").text());
			
            var n = c - 1;
            if(n < <?php echo intval($amount); ?>){
                dialog.alert({
                    title:"提示",
                    msg:"您已购买<?php echo intval($amount); ?>枚",
                    buttons:['确定']
                });
            }else{
                $("#count").text(n);
                $("#count1").text(parseInt($("#count1").text()) - 1);
            }
			setchart();
        })
        
        $("#plus").click(function(){
            var c = parseInt($("#count").text());
            var n = c + 1;
            if(n > (<?php echo $limit_amount; ?>)){
                dialog.alert({
                    title:"提示",
                    msg:"最多只能购买<?php echo $limit_amount; ?>枚",
                    buttons:['确定']
                });
            }else{
                $("#count").text(n);
				$("#count1").text(parseInt($("#count1").text()) + 1);
                setchart();
            }
        })
        
    })
	
	function apply_buy(){
	    if(<?php echo intval($count); ?> > 0){
		   dialog.alert({
				title:"提示",
				msg:'您有订单审核中,请审核完成后再购买!',
				buttons:['确定']
			})
		   return false;
		}
	
	    layer.open({
		  type: 1,
		  shade: false,
		  title: "认购提示", 
		  btn: ['确定','取消'],
		  content: $("#tips"),
		  yes: function(){
		    layer.closeAll();
			if(($("#count1").text() > 0)){
			    location.href = '<?php echo url("trade_list"); ?>?count='+($("#count1").text());
				/*toast.loading({title:"认购中...",duration:1500});
				$.post('<?php echo url("buy_fos"); ?>', {count:$("#count").text()}, function(data){
					data = JSON.parse(data);
					toast.hide();
					if(data.error == 0){
						toast.success({title:data.msg,duration:1500});
						setTimeout(function(){location.reload()}, 1700);
					}else{
						toast.fail({title:data.msg,duration:1500});
						setTimeout(function(){if(data.url){location.href = data.url;}}, 1700);
						
					}
				})*/
			}else{
				dialog.alert({
					title:"提示",
					msg:'请选择认购数量',
					buttons:['确定']
				})
			}
		  }
		});
	}
    
    function setchart(){
        var c = parseInt($("#count").text());
        $(".cp_circle span").css('display', 'inline');
		for(var i=0; i<c; i++){
            $(".cp_circle span").eq(i).css('display', 'none');
        }
    }
</script>
</body>
</html>